#include "command.h"

extern char **environ;

int _printenv(char *argv[])
{
	/* check the number of cmd-line parameters is correct */
	int argc = 0;
	for (char **ptr = argv; *ptr != NULL; ptr++)
		argc++;

	if (argc != 1) {
		fprintf(stderr, "Usage: printenv\n");
		return -1;
	}

	char **ep;
	for (ep = environ; *ep != NULL; ep++)
		puts(*ep);

	return 0;
}
